/*-------------------------------------------------------------------------

   File:		vsform.h
   Project:		VeriFone SoftPay Base
   Description:	Header File for vsaccum.c

***************** Modification History ***********************************

$Log: /SoftPay/SPK2SIM/Source/Include/form.h $
 *
 * 23    3/22/00 2:55p Page_k1
 * Add Merchant name to RCPT_FIELDS
 *
 * 22    3/16/00 10:14a Kevin_v1
 *
 * 21    3/08/00 1:01p Page_k1
 * Change \P(form feed) to six \N(line feeds) in detail report
 *
 * 20    3/06/00 5:28p Page_k1
 * Use 6 line feeds instead of form feed for  Summary report.
 *
 * 19    3/06/00 3:44p Page_k1
 * Change SUMMARY_BOTTOM_END from 190 to 187
 *
 * 18    2/25/00 12:14p Page_k1
 * Remove srRcpt.unFrm.srReceipt.szMerchantID
 *
 * 17    2/21/00 2:59p Jim_b4
 * Include file restructuring
 *
 * 16    2/18/00 1:25p Kevin_v1
 * Remove references to defunct and removed  LOYALTY code and data files.
 *
 * 15    2/08/00 1:41p Kevin_v1
 * Moved logo to top of receipt, changed to print all header lines at once
 * for receipts and reports.
 *
 * 14    1/10/00 4:41p Gary_w2
 * Adjusted footer lines
 *
 * 13    12/14/99 8:21p Monique_b1
 * Changed the values of  SETTLE_TOP_START &  SETTLE_BOTTOM_END
 *
 * 12    12/13/99 5:22p Gary_w2
 * Updated for configurable disclaimer lines
 *
 * 11    12/09/99 1:46p Gary_w2
 * Added changes for new receipt tip table
 *
 * 10    12/06/99 2:42p Angela_s1
 * Changed DETAIL_TOP_END from 109 to 110.
 *
 * 9     12/06/99 9:57a Monique_b1
 * Added back Kevin's change
 *
 * 8     12/03/99 10:35a Gary_w2
 * Added logic for new receipt fields
 *
 * 6     11/01/99 4:30p Angela_s1
 * Added MERCH_REPORT_FORM.
 *
 * 5     10/25/99 4:55p Monique_b1
 * Restore to base version
 *
 * 4     10/25/99 11:17a Gary_w2
 * Make changes for clerk and shift
 *
 * 3     9/13/99 8:30a Chris_s1
 * Changes made to primarily prototypes to conform to the Motorola 68000
 * format...
 *
 * 3     9/03/99 2:17p Kevin_v1
 * Removed batch settle DB definitions.
 *
 * 2     8/04/99 1:53p Monique_b1
 * Remove "vs" prefix from include files
 *
 * 1     7/06/99 9:18a Jim_b4
 *
 * 1     7/06/99 9:16a Jim_b4
 *
 * 5     5/21/99 3:01p Betty_b1
 * Bring into synch with base
 *
 * 4     5/10/99 8:13a Betty_b1
 * Change include filename from vbasize to vsasize
 *
 * 3     5/10/99 8:12a Betty_b1
 * Forgot the include file last time
 *
 * 2     5/10/99 8:10a Betty_b1
 * Bring up-to-date for Nova
 *
 * 10    4/26/99 3:48p Page_k1
 * Move prototypes from vsform.h to pform.h
 *
 * 9     4/08/99 2:17p Chris_s1
 * Prototype corrections...
 *
 * 8     4/07/99 6:24p Chris_s1
 * Header Prototype error corrections...
 *
 * 7     4/05/99 10:25a Chris_s1
 *
 * 6     4/01/99 2:45p Gary_w2
 * Troubleshooting log problem

**************************************************************************

   Copyright (C) 1999 by VeriFone, Inc.

   All rights reserved.  No part of this software may be reproduced,
   transmitted, transcribed, stored in a retrieval system, or translated
   into any language or computer language, in any form or by any means,
   electronic, mechanical, magnetic, optical, chemical, manual or otherwise,
   without the prior written permission of VeriFone, Inc.

---------------------------------------------------------------------------*/

#ifndef VSFORM_H
#define VSFORM_H

#include <recptfrm.h>

#define REPRINT_CONDITION_BIT_MASK          0x10000000
#define TIP_CONDITION_BIT_MASK              0x20000000
#define ISSUE_PRICES_CONDITION_BIT_MASK     0x20000000
#define VOID_CONDITION_BIT_MASK             0x40000000
#define MANUAL_CONDITION_BIT_MASK           0x80000000
#define DEBIT_CONDITION_BIT_MASK            0x01000000
#define ADJUST_CONDITION_BIT_MASK           0x02000000
#define SETTLE_CONDITION_BIT_MASK           0x04000000
#define ECR_INVOICE_CONDITION_BIT_MASK      0x08000000
#define VOID_POINTS_CONDITION_BIT_MASK      0x08000000
#define PRINT_MERCHANT_COPY_MASK            0x00100000
#define TAX_CONDITION_BIT_MASK              0x00200000
#define VOID_PRICES_CONDITION_BIT_MASK      0x00200000
#define PAYMENTS_CONDITION_BIT_MASK         0x00400000
#define REFUND_PRINT_BIT_MASK               0x00800000
#define OPEN_TAB_SIGN_LINE                  0x00010000
#define TRAINING_RECEIPT                    0x00004000
#define NO_AVS_LINE                         0x00060000
#define AVS_LINE                            0x00080000
#define NO_TRANSACTIONS                     0x00002000
#define NO_CASHBACK_LINE                    0x00000040
#define RETAIL_OFF_FLAG                     0x00000080
#define CASH_BACK_FLAG                      0x00000002
#define AUTH_ONLY_FLAG                      0x00000004
#define SURCHARGE_FLAG                      0x00000008
#define CUSTCOPY_FLAG                       0x10000000
#define NO_CONDITIONS                       0L

#define HEADER_START                 1
#define HEADER_END                  10
#define TOP_END                     30
#define MIDDLE_START                31
#define MIDDLE_END                  60
#define BOTTOM_START                61
#define FOOTER_START                110
#define LINEFEEDS_START				115
#define FOOTER_END                  140

/* Definitions for Customer Copy Receipt Support*/
#define TOTAL_END                   51
#define CUSTCOPY_START              97
#define CUSTCOPY_END                98

#define SETTLE_TOP_START            21
#define SETTLE_BOTTOM_END           40
#define REPORT_HEADER_START         83
#define REPORT_HEADER_END           84
#define DETAIL_TOP_START           101
#define DETAIL_TOP_END             110
#define DETAIL_MIDDLE_START        111
#define DETAIL_MIDDLE_END          114 /* changed for O460 */

#define DETAIL_BOTTOM_START        120
#define DETAIL_FORM_FEED           130 /* changed when tax was added bb1 */
#define DETAIL_BOTTOM_END          135
#define SUMMARY_TOP_START          161
#define SUMMARY_TOP_END            170
#define SUMMARY_MIDDLE_START       171
#define SUMMARY_MIDDLE_END         173
#define SUMMARY_BOTTOM_START       181
#define SUMMARY_BOTTOM_END         190
#define SUMMARY_FORM_FEED          191
#define SUMMARY_FORM_FEED_END      199
#define OPENTAB_TOP_START          201
#define OPENTAB_TOP_END            210
#define OPENTAB_MIDDLE_START       211
#define OPENTAB_MIDDLE_END         220
#define OPENTAB_BOTTOM_START       221
#define OPENTAB_BOTTOM_END         229


#define LOYALTY_BOTTOM_START        30
#define LOYALTY_BOTTOM_END          65

#define MAX_CARD_RANGES   25


typedef struct
{
     char szSTAN[STAN_SIZE + 1];
     char szSeqNum[SEQ_SIZE + 1];
     char szBaseAmt[FORMATTED_AMOUNT_SIZE + 1];
     char szTaxAmt[FORMATTED_AMOUNT_SIZE + 1];
     char szTipAmt[FORMATTED_AMOUNT_SIZE + 1];
     char szSChg[FORMATTED_AMOUNT_SIZE + 1];
     char szCBack[FORMATTED_AMOUNT_SIZE + 1];
     char szTotAmt[FORMATTED_AMOUNT_SIZE + 1];
	 char szSubTotAmt[FORMATTED_AMOUNT_SIZE + 1];
     char szAcctNum[FORMATTED_PAN_SIZE + 1];
     char szExpDate[FORMATTED_EXP_DATE_SIZE + 1];
     char szCType[CLABEL_SIZE + 1];
     char szCHolder[CHOLDER_SIZE + 1];
     char szCSymbol[CUR_SYMBOL_SIZE + 1];
     char szApprovalCode[AUTH_CODE_SIZE + 1];
     char szRefCustNumber[REF_CUST_SIZE + 1];
     char szAppCrypt[ADD_RESP_SIZE + 1];
     char szTVRValue[ADD_RESP_SIZE + 1];
	 char szAIDValue[ADD_RESP_SIZE + 1];
	 char szApplName[ADD_RESP_SIZE + 1];
     char szECRInvNo[ECR_INVNUM_SIZE + 1];
     char szServId[MERCH_ID_SIZE + 1];
     char szSettDate[SETT_DATE_SIZE + 1];
     char chShift;
     char szEntryMethod[MESSAGE_SIZE];
     char szApprovalType[MESSAGE_SIZE];
	 char szDebitRefNum[HOST_REF_SIZE + 1];
     char szOrigTransDate[ORIG_TRANS_DATE_SIZE + 1];
     char szOrigTransTime[TIME_SIZE + 1];
     char szCVV2RespCode[MESSAGE_SIZE];
     char szGenBuf1[RESP_MSG_SIZE + 1];
     char szGenBuf2[RESP_MSG_SIZE + 1];
     char szGenBuf3[RESP_MSG_SIZE + 1];
     char szGenBuf4[RESP_MSG_SIZE + 1];
     char szGenBuf5[RESP_MSG_SIZE + 1];
     char szGenBuf6[RESP_MSG_SIZE + 1];
     /****** Loyalty Fields
     char szLoyaltyMessageId[LMSG_ID_SIZE + 1];
     char szLoyAcctNum[PAN_SIZE + 1];
     char szLoyAmt[FORMATTED_AMOUNT_SIZE + 1];
     char szLoyPoints[FORMATTED_AMOUNT_SIZE + 1];
     char szLoyLabelTotal[FORMATTED_AMOUNT_SIZE + 1];
     char szLoyTotalPoints[FORMATTED_AMOUNT_SIZE + 1];
     char szLoyLifePoints[FORMATTED_AMOUNT_SIZE + 1];
     ***********/
} RECEIPT_FORM;



typedef struct
{
     char szCreditCount[INT_STR_SIZE + 1];
     char szDebitCount[INT_STR_SIZE + 1];
     char szAdjustCount[INT_STR_SIZE + 1];
     char szNetCount[INT_STR_SIZE + 1];
     char szReversalCount[INT_STR_SIZE + 1];
     char szTipCount[INT_STR_SIZE + 1];
     char szTotalSurchgCnt[INT_STR_SIZE + 1];
     char szCreditTotal[FORMATTED_AMOUNT_SIZE + 1];
     char szDebitTotal[FORMATTED_AMOUNT_SIZE + 1];
     char szAdjustTotal[FORMATTED_AMOUNT_SIZE + 1];
     char szReversalTotal[FORMATTED_AMOUNT_SIZE + 1];
     char szNetTotal[FORMATTED_AMOUNT_SIZE + 1];
     char szCashBack[FORMATTED_AMOUNT_SIZE + 1];
     char szTotalSchgAmt[FORMATTED_AMOUNT_SIZE + 1];
     char szCBackCount[INT_STR_SIZE + 1];
     char szTipTotal[FORMATTED_AMOUNT_SIZE + 1];
     char szTaxTotal[FORMATTED_AMOUNT_SIZE + 1];
     char szCSymbol[CUR_SYMBOL_SIZE + 1];
     char szLoyaltyAccrual[FORMATTED_AMOUNT_SIZE + 1];
     char szLoyaltyRedeem[FORMATTED_AMOUNT_SIZE + 1];
     char szLoyaltyReturn[FORMATTED_AMOUNT_SIZE + 1];

} TOTALS_FORM;

typedef struct
{
     TOTALS_FORM srTerm;
     TOTALS_FORM srHost;
} SUBTOTAL_REPORT_FORM;


typedef struct
{
    char szMerchantNum[MERCH_INDEX_SIZE + 1];
    char szMerchantName[MESSAGE_SIZE + 1];
    char szHostName[HOST_NAME_SIZE + 1];
    char szMerchantID[MERCH_ID_SIZE + 1];
} MERCH_REPORT_FORM;


typedef union
{
    RECEIPT_FORM                    srReceipt;
    DETAIL_REPORT_FORM              srDet;
    CLERK_REPORT_FORM               srClerk;
    SUMMARY_REPORT_FORM             srSummary;
    SUBTOTAL_REPORT_FORM            srSubTotal;
    OPENTAB_REPORT_FORM             srOTab;
    SHIFT_REPORT_FORM               srShift;
    HOST_CAPTURE_REPORT_FORM        srHostCapture;
    MERCH_REPORT_FORM               srMerch;
} FORMS;

typedef struct
{
     char szTransName[MESSAGE_SIZE + 1];
     char szHeaderLine[RECEIPT_HEADER_SIZE + 1];
     char szHeaderLine2[RECEIPT_HEADER_SIZE + 1];
     char szHeaderLine3[RECEIPT_HEADER_SIZE + 1];
     char szHeaderLine4[RECEIPT_HEADER_SIZE + 1];
     char szHeaderLine5[RECEIPT_HEADER_SIZE + 1];
     char szHeaderLine6[RECEIPT_HEADER_SIZE + 1];
     char szDate[FORMATTED_DATE_SIZE + 1];
     char szTime[FORMATTED_TIME_SIZE + 1];
     char szMerchantId[MERCH_ID_SIZE + 1];
     char szMerchantName[MESSAGE_SIZE + 1];
     char szTermId[TERM_ID_SIZE + 1];
     char szClerkId[CLERK_ID_SIZE + 1];
     char szHostName[HOST_NAME_SIZE + 1];
     char szBatchNum[BATCH_NUM_SIZE + 1];
     char szInvNum[INV_NUM_SIZE + 1];
     char szAVSCode[AVS_CODE_SIZE + 1];
     char szTipAmt1[FORMATTED_AMOUNT_SIZE + 1];
     char szTipAmt2[FORMATTED_AMOUNT_SIZE + 1];
     char szTipAmt3[FORMATTED_AMOUNT_SIZE + 1];
     char szTipPct1[FORMATTED_AMOUNT_SIZE + 1];
     char szTipPct2[FORMATTED_AMOUNT_SIZE + 1];
     char szTipPct3[FORMATTED_AMOUNT_SIZE + 1];
     FORMS unFrm;
     char szRctDisclaimer1[MESSAGE_SIZE + 1];
     char szRctDisclaimer2[MESSAGE_SIZE + 1];
     char szRctDisclaimer3[MESSAGE_SIZE + 1];
     char szRctDisclaimer4[MESSAGE_SIZE + 1];
     char szRctDisclaimer5[MESSAGE_SIZE + 1];
     char szSpecialMessage[RECEIPT_HEADER_SIZE + 1];
     char szStatusMessage[RECEIPT_HEADER_SIZE + 1];
     char szStatus2Message[RECEIPT_HEADER_SIZE + 1];
     char szErrorMessage[RECEIPT_HEADER_SIZE + 1];
	 char szMultiAppMsg1[RECEIPT_HEADER_SIZE + 1];
	 char szMultiAppMsg2[RECEIPT_HEADER_SIZE + 1];
     char szAmt[FORMATTED_AMOUNT_SIZE + 1];
     char szTipAmt[FORMATTED_AMOUNT_SIZE + 1];
     char szTranStatus[TRAN_STATUS_SIZE + 1];
     char szAdjust;
  } RCPT_FIELDS;

#define SIZE_RCPT_FIELDS   sizeof(RCPT_FIELDS)

extern RCPT_FIELDS srRcpt;       /* Receipt fields */

typedef struct
{
	char szOdometer[ FLEET_ODOMETER_SIZE + 1 ];
	char szDriverNum[ FLEET_DRIVER_NUM_SIZE + 1 ];
	char szVehicleNum[ FLEET_VEHICLE_NUM_SIZE + 1 ];
	char szDesc[3][ FLEET_DESC_SIZE + 1 ][3];
	char szQuantity[3][ FLEET_QUANTITY_SIZE + 1 ][3];
	char szAmount[3][ FORMATTED_AMOUNT_SIZE + 1 ];

} FLEET_RCPT_FIELDS;

extern FLEET_RCPT_FIELDS srFleetRcpt;       /* Fleet Card Receipt fields */

#define REPRINT_FILE_NAME           "REPRINT.RCT"

#endif  /* VSFORM_H */


